<?php
/**
 * @category ContentEngine
 * @package Goatherd\Content\Engine
 *
 * @author Copyright (c) 2012 Maik Penz <maik@phpkuh.de>
 * @version $Id: Item.php 87 2012-03-28 22:52:43Z maik@phpkuh.de $
 *
 * This file is part of Goatherd library.
 *
 * Goatherd library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * Goatherd library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Goatherd library. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Goatherd\Content\Engine\Queue;

/**
 * Default item using the writer interface.
 *
 * @category ContentEngine
 * @package Goatherd\Content\Engine\Reader
 * @subpackage Queue
 */
class Item
extends AbstractItem
{
    /**
     *
     * @var boolean
     */
    protected $_writable = true;

    /**
     * (non-PHPdoc)
     * @see Goatherd\Content\Engine\Queue.AbstractItem::persist()
     */
    public function persist()
    {
        return $this->getSource()
                    ->getWriter()
                    ->persist($this);
    }

    /**
     * (non-PHPdoc)
     * @see Goatherd\Content\Engine\Queue.AbstractItem::getRelatedItems()
     */
    public function getRelatedItems()
    {
        $rs = $this->getSource()
                   ->getWriter()
                   ->getRelatedItems($this);

        return $rs;
    }
}